#include<bits/stdc++.h>
#define int long long
using namespace std;
inline int read()
{
	int res=0,f=1;char c=getchar();
	while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
	while(c>='0'&&c<='9'){res=(res<<1)+(res<<3)+(c^48);c=getchar();}
	return res*f;
}
void write(int x)
{
	if(x<0)putchar('-'),x=-x;
	if(x>9)write(x/10);
	putchar(x%10+'0');
}
int n,a[114514];
int ans=1;
const int mod=998244353;
signed main()
{
	freopen("trade.in","r",stdin);
	freopen("trade.out","w",stdout);
	n=read();
	for(int i=1;i<=n;i++) a[i]=read(),ans=ans*a[i]%mod;
	write(ans);
	return 0;
}
